package com.zyit.web;

import com.zyit.entity.T_notice;
import com.zyit.service.Impl.NewsServiceImpl;
import com.zyit.service.NewsService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.List;

@WebServlet("/Detail")
public class NewsDetailServlet extends HttpServlet {
    private NewsService newsService = new NewsServiceImpl();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        List<T_notice> t_noticeList = newsService.findDetail(id);
        HttpSession session =req.getSession();
        session.setAttribute("t_noticeList",t_noticeList);
        req.getRequestDispatcher("/manager/notice/noticeDetail.jsp").forward(req,resp);
    }
}
